﻿#ifndef ZMQSUBSCRIBER_H
#define ZMQSUBSCRIBER_H

#include <QObject>
#include "zmq.h"
#include "myhead.h"
#include "basesubscriber.h"


class ZmqSubscriber : public BaseSubscriber
{
    Q_OBJECT
public:
    Q_INVOKABLE explicit ZmqSubscriber(QObject *parent = nullptr);

signals:

public slots:

public:
    virtual bool connectToHost() override;
    virtual bool isConnected() override;
    virtual bool disConnect() override;


private:
    void * _context = NULL;     //订阅模式的ZMQ上下文环境
    void * _socket = NULL;

    bool isRun=false;

    bool initSUBModuleConnect();
    void run();
};

#endif // ZMQSUBSCRIBER_H
